<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<input type="text" name="" id="" />
		<button @click="debouch.cancel()">取消</button>
	</body>
	<script src="./index.js"></script>
	<script>
		let count = 0
		function inputE(val) {
			console.log(`${++count}次请求`, this, val)
			return 11
		}
		// const _debouch = debouch(inputE, 2000)
		// 防抖
		// document.querySelector('input').oninput = _debouch
		// document.querySelector('button').onclick = _debouch.cancel

		// 节流
		// document.querySelector('input').oninput = throttle(inputE)

		// 深拷贝
		// let s1 = Symbol('llll')
		// let s2 = Symbol('222')
		// let obj = {
		// 	name: 'lisi',
		// 	info: {
		// 		address: 'zhansan',
		// 		phone: '454545',
		// 	},
		// 	arr: [1, 2, 3, 1],
		// 	say() {},
		// 	[s2]: s1,
		// 	s1,
		// }
		// 对 Symbol 、 function 、 循环引用
		// let copyObj = JSON.parse(JSON.stringify(obj))
		// let copyObj = deepClone(obj)

		// obj.name = 'llvyr'
		// obj.arr = [11]
		// obj.hh = obj
		// console.log(copyObj)
		// console.log(obj)
		// console.log(copyObj.s1 === obj.s1)

		document.querySelector('input').oninput = throttle(inputE, 2000, true)
	</script>
</html>
